package com.papper.common.enums;

/**
 * @Author:Lajiao
 * @Date:2014年7月14日
 * @Time:下午3:49:44
 * @Description:数据状态定义
 */
public enum PayTypeEnum {
    NOCARD(1, "银行无卡快捷", "1000"),
    MPOS(2, "蓝牙卡头", "9001"),
    QRCODE(3, "微信支付", "0100"),
    ALIPAY(4, "支付宝支付", "0001"),
    QQPAY(5, "QQ支付", "7201"),
    JDPAY(6, "京东支付", "7301"),
    UNIONPAY(7, "银联扫码", "7101"),
    WXGZH(8, "微信公众号", "8004"),
    ALFWH(9, "支付宝公众号", "8004"),
    GATEWAY(10, "银联网关", "1000"),
    UNIONH5(11, "银联H5支付", "1000"),
    UNIONAPP(12, "银联控件支付", "1000"),
    JDH5(13, "京东H5支付", "1000"),
    QQH5(14, "QQH5支付", "1000"),
    WXH5(15, "微信H5支付", "1000"),
    CREDIT(16, "信用卡代还", "1000"),
    ALIH5(17, "支付宝H5", "0010"),
    MCG(18, "银企直连代付", "1000"),
    WXPHOTO(19, "微信扫一扫识别", "0100"),
    ALIPAYPHOTO(20, "支付宝扫一扫识别", "0001"),
    ALIPAYCARD(21, "银行卡转账", "0001"),
    UNIONCARD(22, "银行卡转卡", "0001"),
    YFFCARD(31, "预付费卡", "1000"),
    ZFBPDD(41, "支付宝原生", "1000"),
    ZFBGDM(42, "支付宝固定码", "1000"),
    ZFBGRZZ(43, "支付宝个人转账", "1000"),
    ZFBHBZZ(44, "支付宝红包转账", "1000"),
    ZFBCARD(45, "支付宝转卡", "1000"),
    WANGXIN(46, "淘宝现金红包", "1000"),

    WXGDM(51, "微信国定码", "1000"),
    WXZSM(52, "微信赞赏码", "1000"),

    SNZFBH5(61, "苏宁支付宝H5", "1000"),
    SNWXH5(62, "苏宁微信H5", "1000"),
    P1901(1901, "银行卡复制转账", "0001"),
    P3001(3001, "三网话费充值", "3004"),
    P110107(110107, "支付宝境外码", "110000"),
    P110108(110108, "支付宝手机网站", "110000"),
    P120107(120107, "微信签约商城", "120000"),
    P120109(120109, "微信京东礼品卡", "120000");

    private Integer code;
    private String  name;
    private String  goodsId;

    PayTypeEnum(Integer code, String name, String goodsId) {
        this.code = code;
        this.name = name;
        this.goodsId = goodsId;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public static String getName(Integer code) {
        if (code == null) {
            return "";
        }
        for (PayTypeEnum re : PayTypeEnum.values()) {
            if (re.getCode().equals(code)) {
                return re.getName();
            }
        }
        return "";
    }

    public static Integer getCode(String name) {
        if (name == null) {
            return null;
        }
        for (PayTypeEnum re : PayTypeEnum.values()) {
            if (name.equals(re.getName())) {
                return re.getCode();
            }
        }
        return null;
    }

    public static String getGoodsId(Integer code) {
        if (code == null) {
            return "1000";
        }
        for (PayTypeEnum re : PayTypeEnum.values()) {
            if (re.getCode().equals(code)) {
                return re.getGoodsId();
            }
        }
        return "1000";
    }
}
